package sctu.edu.java.year2016.team02.huangguojing.day20160602.Chapter9_2;

import java.util.Scanner;

/**
 * Created by Eoly on 2016/6/2.
 * 编写Java程序，创建一个类，在该类中定义一个方法，并在方法内部创建一个局部内部类，通过局部内部类求任意两数的乘积，并在外部类中进行测试。
 */
public class Multiplicative {
    void getMultip(int a, int b) {
        class Multip {

            int a, b, c;

            public Multip(int a, int b) {
                this.a = a;
                this.b = b;
                c = a * b;
            }
        }
        Multip mul = new Multip(a, b);
        System.out.println(a + "*" + b + "=" + mul.c);
    }

    public static void main(String[] args) {
        System.out.print("Enter two number:");

        Multiplicative mul = new Multiplicative();
        Scanner scan = new Scanner(System.in);
        mul.getMultip(scan.nextInt(), scan.nextInt());
    }

}
